<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
<head>
		<base href="<%=basePath%>">
		<meta charset="utf-8" />
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<!-- basic styles -->
		<link rel="stylesheet" href="assets/css/bootstrap.min.css" />
		<link rel="stylesheet" href="assets/css/bootstrap-responsive.min.css" />
		<link rel="stylesheet" href="assets/css/font-awesome.min.css" />
		<link rel="stylesheet" href="assets/css/ace.min.css" />
		<link rel="stylesheet" href="assets/css/bootstrap-datepicker.css" />
	

</head>
<body>
	<div class="main-container" id="main-container">
		<script type="text/javascript">
				try{ace.settings.check('main-container' , 'fixed')}catch(e){}
			</script>

			<div class="main-container-inner">
				<div class="breadcrumbs" id="breadcrumbs">
					<script type="text/javascript">
						try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
					</script>
				<ul class="breadcrumb">
					<li><i class="icon-home home-icon"></i> <a>报表</a></li>
					<li class="active">每日报表</li>
				</ul>
				<div class="nav-search" id="nav-search" style="vertical-align: top;">
						 <form id="searchForm" class="form-search"
							action="reports/day_reports_list.do" method="post">
							 <input type="text" name="time"  id="time"  value="${time}"  data-format="yyyy-MM" class="date-picker"  style="height:29px;border:1px solid #6fa8dc;background-color:#fff;color:#a9a9a9;box-sizing: border-box;"/> 
						<button id="btnSearch" type="button" class="btn btn-info btn-sm">
							<i class="icon-search icon-only"></i>
						</button>
						</form> 
					</div>
					<!-- #nav-search -->
				</div>
				<div class="page-content">
					<div class="page-header">
						<b>每日报表列表</b>
					</div>
					
					<!-- /.page-header -->
					<!-- PAGE CONTENT BEGINS -->
					<div class="row">
						<div class="col-xs-12">
							<div class="table-responsive">
								<table id="sample-table-1"
									class="table table-striped table-bordered table-hover">
									<thead>
										<tr>
											<th class="center"><label><input type="checkbox"
													class="ace" /><span class="lbl"></span> </label></th>
											<th>时间</th>
											<th>新增用户</th>
											<th>新增直播</th>
											<th>参与者</th>
											<th>直播时间</th>
										</tr>
									</thead>
									<tbody>
										<c:forEach items="${reportsList}" var="reports">
											<tr>
												<td class="center"><label><input
														type="checkbox" name="IDCK" class="ace"
														value="${reports.id}" /><span class="lbl"></span> </label></td>
												<td>${reports.time}</td>
												<td>${reports.newUsers}</td>
												<td>${reports.meetings}</td>
												<td>${reports.participants}</td>
												<td>${reports.meetingMinutes}</td>
											</tr>
										</c:forEach>
									</tbody>
								</table>
						</div>
						<!-- /.table-responsive -->
					</div>
					<!-- /span -->
				</div>
				<!-- /row -->
				<div style="height: 35px;">
					<div style="float: left;">
						<button id="btn_fresh"  onclick="formFresh();" class="btn btn-sm btn-info">
							<i class="icon-refresh bigger-120 icon-only"></i>
						</button>
						<button id="btn_export" class="btn btn-sm btn-default">
						<i class="icon-cloud-download bigger-120 icon-only"></i></button>
					</div>
				</div>
			</div>
			<!-- /.page-content -->
		</div>
		<!-- /.main-container-inner -->
	</div>
		<script type="text/javascript" src="assets/js/jquery-1.10.2.min.js"></script>
		<!-- 引入 -->
		<script type="text/javascript" src="assets/js/bootstrap.min.js"></script>
		<script type="text/javascript" src="assets/js/date-time/bootstrap-datepicker.js"></script>
	<script type="text/javascript"  src="assets/js/date-time/locales/bootstrap-datepicker.zh-CN.js"></script>
		<script type="text/javascript">
		$(function() {
			$('.date-picker').datepicker({
                language: 'zh-CN',
                autoclose: true,
                todayHighlight: true,
                format:"yyyy-mm"
            });
		});
			$( "#btnSearch" ).on('click', function(e) {
				$("#searchForm").submit();
			});
			function formFresh() {
				$("#searchForm").submit();
			}
			
			$( "#btn_add" ).on('click', function(e) {
				window.parent.showDialog("添加供应商信息",'<%=basePath%>agent/agent_add.do',400,430);
			});
			$( "#btn_del" ).on('click', function(e) {
				var ids = '';
				$sel = $("input:checkbox[name='IDCK']:checked");
				if($sel.length == 0){
					window.parent.showConfirm("请选择删除记录 !!!");	
				}else {
					var len =$sel.length;
					$sel.each(function(){
						ids += this.value + ",";
					});
					var yes = function() {
						var url = '<%=basePath %>agent/agent_delAll.do?ids='+ids;
						$.post(url,function(){
							$("#searchForm").submit();
						});
					};
					window.parent.showConfirm("你确定要删除以上 "+len+" 条记录吗？",yes);
				};
				
			});
			$( "#btn_export" ).on('click', function(e) {
				window.location.href='<%=basePath%>reports/excel.do';
			});
			$( "#btn_fresh" ).on('click', function(e) {
				$("#searchForm").submit();
			});
			function edit(id) {
				window.parent.showDialog("编辑供应商信息",'<%=basePath%>agent/agent_edit.do?id='+id,400,420);
			};
			function del(id) {
				var yes = function() {
					var url = '<%=basePath %>agent/agent_del.do?id='+id;
					$.post(url,function(){
						window.parent.showAlert("好吧，删了！");
						$("#searchForm").submit();
					});
				};
				window.parent.showConfirm("你确定要删除此条记录吗？",yes);
			};
			function showTips(obj, tips) {
				obj.tips({
					side : 3,
					msg : tips,
					bg : '#e69138',
					time : 2
				});
			}
			var a = new Date();
			var month = a.getMonth()+1;
			if(month<10){
				month = "0" +month;
			}
			$("#time").val(a.getFullYear()+"-"+month);
		</script>
	</body>
</html>

